import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'

// 定义当前应用它的路由模式 BrowserRouter, HashRouter
import { BrowserRouter as Router } from 'react-router-dom'

// 给原生的String添加一个toSearch方法
String.prototype.toSearch = function () {
  const search = this + ''
  return Object.fromEntries(new URLSearchParams(search).entries())
}

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  <Router>
    <App />
  </Router>
)
